package manager;

import java.util.List;

import model.Customers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import idao.ICustomersDAO;
import imanager.ICustomersManager;

@Service
public class CustomersManager implements ICustomersManager {

	@Autowired
	private ICustomersDAO customersDAO;

	public ICustomersDAO getCustomersDAO() {
		return customersDAO;
	}

	public void setCustomersDAO(ICustomersDAO customersDAO) {
		this.customersDAO = customersDAO;
	}

	public CustomersManager() {
		// TODO Auto-generated constructor stub
	}

	@Transactional
	public boolean insert(Customers customers) {
		// TODO Auto-generated method stub
		return customersDAO.insert(customers);
	}

	@Transactional
	public boolean update(Customers customers) {
		// TODO Auto-generated method stub
		return customersDAO.update(customers);
	}

	@Transactional
	public boolean delete(Customers customers) {
		// TODO Auto-generated method stub
		return customersDAO.delete(customers);
	}

	@Transactional
	public Customers getCustomerByUser(String user) {
		// TODO Auto-generated method stub
		return customersDAO.getCustomerByUser(user);
	}

	@Transactional
	public List<Customers> getAll() {
		// TODO Auto-generated method stub
		return customersDAO.getAll();
	}

}
